package com.sicent.app0013.operate.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.sicent.app0013.operate.data.InternetBarData;
import com.sicent.app0013.operate.model.InternetBar;
import com.sicent.operate.common.result.ApiResult;

@RestController
@RequestMapping("bar")
public class InternetBarController {

	@Autowired
	private InternetBarData internetBarData;
	
	@RequestMapping("/findBarComments")
	public ApiResult findBarComments(Integer pageNo, Integer pageSize) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("snbid", "jswx");
		map.put("name", null);
		List<InternetBar> list = internetBarData.findByInfo(map, pageNo, pageSize);
		return new ApiResult(list);
	}
	
	@RequestMapping("/test")
	public ApiResult test(){
		return new ApiResult(internetBarData.getById(468));
	}

	@RequestMapping("/test1")
	public ApiResult test1(){
		return new ApiResult(internetBarData.getById(467));
	}
	
	@RequestMapping("/testUser")
	public ApiResult testUser(){
		return new ApiResult(internetBarData.findByUserId(34063057));
	}
	
	@RequestMapping("/testData")
	public ApiResult testData(Integer id){
		return new ApiResult(internetBarData.findById(id));
	}
}
